package com.example.onlinemallsystem.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class Order {
    // 对应表中 id 字段，bigint 类型，用 Long 映射，自动递增
    private Long id;
    // order_no 字段，varchar(32)
    private String orderNo;
    // user_id 字段，bigint
    private Long buyerId;
    private Long sellerId;
    private Long productId;
    private String productName;
    private int quantity;
    // total_amount 字段，decimal(10,2)，精准小数用 BigDecimal
    private BigDecimal totalAmount = BigDecimal.ZERO;
    // pay_status 字段，tinyint，默认 0，用 Integer 映射
    private Integer payStatus = 0;
    // order_status 字段，tinyint，默认 0
    private Integer orderStatus = 0;
    // receiver_name 字段，varchar(60)
    private String receiverName;
    // receiver_phone 字段，varchar(20)
    private String receiverPhone;
    // receiver_address 字段，varchar(255)
    private String receiverAddress;
    // pay_time 字段，datetime，用 Date 类型（若用 JDK8+ 也可考虑 LocalDateTime ）
    private Date payTime;
    // ship_time 字段，datetime
    private Date shipTime;
    // cancel_time 字段，datetime
    private Date cancelTime;
    // create_time 字段，datetime，默认当前时间
    private Date createTime;
    // update_time 字段，datetime，默认当前时间
    private Date updateTime;
    private String buyerName;
    private String sellerName;
    private User user;
    private Product product;
}
